package org.smart4j.chapter2.util;

import org.apache.commons.lang3.StringUtils;

/**
 * Created by Cai on 2017/7/18.
 * 字符串工具类
 */
public final class StringUtil {

    /*判断字符串是否为空*/
    public static boolean isEmpty(String str){
        if(str != null){
            str = str.trim();
        }

//        return StringUtils.isEmpty(str);
        return str == null || str.length() == 0;
    }

    /*判断字符串是否非空*/
    public static boolean isNotEmpty(String str){
        return !isEmpty(str);
    }

}
